package com.ruoyi.mes.domain;

import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.mes.domain.ProBomMaterial;
/**
 * BOM管理对象 pro_bom
 * 
 * @author CFL
 * @date 2024-04-28
 */
public class ProBom extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    private Long id;

    /** bom编号 */
    @Excel(name = "bom编号")
    private String bomSn;

    /** 产品id */
    private Long proId;

    //物料数组
    private List<ProBomMaterial> mtrs;


    /** 产品编码 */
    private String proSn;

    /** 产品名称 */
    private String proName;

    /** 产品类型 */
    private Long proType;

    /** 物料id */
    private Long materId;

    /** BOM物料表中的bomid */
    private Long bomId;

    /** BOM物料表中的物料id */
    private Long matId;

    /** BOM物料表中的物料数量 */
    private Double matNum;

    /** 逻辑删除;0：存在；1：删除 */
    private Long isDeleted;

    /** 创建者 */
    @Excel(name = "创建者")
    private String createdBy;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdTime;

    /** 更新者 */
    private String updatedBy;

    /** 更新时间 */
    private Date updatedDate;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setBomSn(String bomSn) 
    {
        this.bomSn = bomSn;
    }

    public String getBomSn() 
    {
        return bomSn;
    }
    public void setIsDeleted(Long isDeleted) 
    {
        this.isDeleted = isDeleted;
    }

    public Long getIsDeleted() 
    {
        return isDeleted;
    }

    public Long getProId(){return proId;}

    public void setProId(Long proId){ this.proId = proId; }

    public String getProSn(){return proSn;}

    public void setProSn(String  proSn){ this.proSn = proSn; }

    public String getProName(){return proName;}

    public void setProName(String  proName){ this.proName = proName; }

    public Long getProType(){return proType;}

    public void setProType(Long proType){ this.proType = proType; }

    public Long getMaterId() {
        return materId;
    }

    public void setMaterId(Long materId) {
        this.materId = materId;
    }

    public Long getBomId() {
        return bomId;
    }

    public void setBomId(Long BomId) {
        this.bomId = bomId;
    }

    public List<ProBomMaterial> getMtrs() {
        return mtrs;
    }

    public void setMtrs(List<ProBomMaterial> mtrs) {
        this.mtrs = mtrs;
    }

    public Long getMatId() {
        return matId;
    }

    public void setMatId(Long matId) {
        this.matId = matId;
    }

    public Double getMatNum() {
        return matNum;
    }

    public void setMatNum(Double matNum) {
        this.matNum = matNum;
    }

    public void setCreatedBy(String createdBy) 
    {
        this.createdBy = createdBy;
    }

    public String getCreatedBy() 
    {
        return createdBy;
    }
    public void setCreatedTime(Date createdTime) 
    {
        this.createdTime = createdTime;
    }

    public Date getCreatedTime() 
    {
        return createdTime;
    }
    public void setUpdatedBy(String updatedBy) 
    {
        this.updatedBy = updatedBy;
    }

    public String getUpdatedBy() 
    {
        return updatedBy;
    }
    public void setUpdatedDate(Date updatedDate) 
    {
        this.updatedDate = updatedDate;
    }

    public Date getUpdatedDate() 
    {
        return updatedDate;
    }

    @Override
    public String toString() {
//        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
//            .append("id", getId())
//            .append("bomSn", getBomSn())
//             .append("materId",getMaterId())
//            .append("remark", getRemark())
//            .append("isDeleted", getIsDeleted())
//            .append("createdBy", getCreatedBy())
//            .append("createdTime", getCreatedTime())
//            .append("updatedBy", getUpdatedBy())
//            .append("updatedDate", getUpdatedDate())
//
//            .toString();

        ToStringBuilder ts = new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE);

        ts.append("id", getId())
            .append("bomSn", getBomSn())
             .append("materId",getMaterId())
            .append("remark", getRemark())
            .append("isDeleted", getIsDeleted())
            .append("createdBy", getCreatedBy())
            .append("createdTime", getCreatedTime())
            .append("updatedBy", getUpdatedBy())
            .append("updatedDate", getUpdatedDate());

        for (ProBomMaterial p: getMtrs()) {
            ts.append(p);
        }

        return ts.toString();
    }
}
